* daily equity index
use "$datapath/MSCI_daily_exceldata_to_DTA.dta", clear

* daily returns
bys country (dated) : gen r = (usdmsci - usdmsci[_n-1])/usdmsci[_n-1]

* sample selection
keep if datem >= ym(2001,12) & datem <= ym(2016,12)
keep dated country  r // keep key variables

* save data
save "$datapath/MSCI_daily_equity_returns.dta", replace
* end
*******************************************************************